import React from 'react';
import {useLocation, Redirect} from "umi";

export default function Film(props:any) {

  // 嵌套路由重定向
  // if (判断路由是'/film'){
  //   直接跳到路由'/film/nowplaying'
  // }
  const location = useLocation()  // => props.location
  if (location.pathname === '/film'){
    return <Redirect to='/film/nowplaying'/>
  }


  return (
    <div>
      film
      {props.children}
    </div>
  )
}
